package com.dau.mapper.mapper.user;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dau.common.constants.CommConstants;
import com.dau.entity.system.dept.SysDept;
import com.dau.entity.system.user.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 系统用户映射器
 *
 * @author tzj
 * @date 2024/11/07
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    /**
     * 分页查询用户
     *
     * @param build          建造
     * @param sysUserWrapper sys用户参数
     * @return {@link Page }<{@link SysUser }>
     */
    Page<SysUser> selectUserPage(@Param(CommConstants.PAGE) Page<SysUser> build, @Param(Constants.WRAPPER) Wrapper<SysUser> sysUserWrapper);

    /**
     * 通过用户id查询部门列表
     *
     * @param userId 用户id
     * @return {@link List }<{@link SysDept }>
     */
    List<SysDept> selectDeptListByUserId(@Param("userId") Long userId);
}
